#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

drop table edu_dm.dm_relationship;
create table edu_dm.dm_relationship(
    date_time                   string,
    dt_group_type               string,
    group_type_new              string,
    origin_type                 string,
	itcast_school_id            int,
	school_name                 string,
	itcast_subject_id           int,
	subject_name                string,
	origin_channel              string,
	area                        string,
	tdepart_id                  int,
	dep_name                    string,
	clue_state                  string,
	year_date                   string,
	month_date                  string,
	day_date                    string,
	hour_date                   string,
	group_type_old              string,
	customer_relationship_amount bigint

)
comment '意向主题粗细粒度宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress'='snappy');


drop table edu_dm.dm_clue;
create table edu_dm.dm_clue(
    date_time                   string,
    dt_group_type               string,
    group_type_new              string,
    origin_type                 string,
	clue_state                  string,
	year_date                   string,
	month_date                  string,
	day_date                    string,
	hour_date                   string,
	group_type_old              string,
	clue_amount                 bigint,
	val_clue_amount             bigint

)
comment '线索主题粗细粒度宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress'='snappy');